/**
 * creation: 17-apr-2008
 */
package org.jfonia.connect;

/**
 * Callable which sets the value of a target to the value of a given source
 * 
 * @author wijnand.schepens@gmail.com
 *
 */
public class Setter<T> implements Callable
{
	protected MutableValue<T> target;
	protected Value<T>        source;

	public Setter(MutableValue<T> target, Value<T> source)
	{
		this.target = target;
		this.source = source;
	}

	/**
	 * Source value is set to new value obtained by calculate(old source value).
	 * @return always returns true
	 */
	public boolean call(Object param)
	{
		target.set(source.get());
		return true;
	}
}
